package exception.exception02;

import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;

import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseDemo {
    public static void main(String[] args) {
        System.out.println( "开始了");
        try(FileOutputStream fos = new FileOutputStream("/a/a/a/fos.dat")) {
            fos.write(1);
            System.out.println("正在写");
        }catch (IOException e){
            System.out.println("出现异常了");
            e.printStackTrace();
        }


        System.out.println("结束了");
    }
}
